<?php

namespace App\Controller\Web;

use App\Base\BaseConfig;
use App\Base\BaseController4Web;
use App\Model\AdPageModel;
use App\Model\ArtCategoryModel;
use App\Model\ArtModel;
use App\Model\ContactAddressModel;
use App\Model\PagesModel;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Component\HttpFoundation\Request;

class AdPageController extends BaseController4Web
{
    /**
     * @route("/page/ad",name="WebAdPage")
     */
    public function WebAdPage(){
        $this->initData();
        $this->data["headTab"] = 'about';
        if (!$code = $this->getParamRequired("code")) {die;}
        $AdPageModel = new AdPageModel($this->getDoctrine());
        $en = $AdPageModel->getById($code);
        $en = $this->toArray($en);
        $en["content"] = $this->dealWithImgInHtml($en["content"]);
        $this->data["en"] = $en;

        return $this->render("Web/ad_page.html.twig", $this->data);
    }
}
